﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="addnew.aspx.cs" Inherits="AdventureWorksWebApp.addnew" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="header">
        <h2>
            Dodaj nowy produkt</h2>
    </div>
    <div id="details">
        <asp:Label ID="lbProductName" runat="server" Text="Product Name: " CssClass="details_labels" />
        <asp:TextBox ID="txtProductName" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtProductName" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:Label ID="lbProductNumber" runat="server" Text="Product Number: " CssClass="details_labels" />
        <asp:TextBox ID="txtProductNumber" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtProductNumber" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:Label ID="lblCategory" runat="server" Text="Category: " CssClass="details_labels" />
        <asp:DropDownList ID="ddCategory" runat="server" CssClass="details_text" OnSelectedIndexChanged="ddCategory_SelectedIndexChanged"
            AutoPostBack="true">
        </asp:DropDownList>
        <asp:Label ID="lblSubcategory" runat="server" Text="Subcategory: " CssClass="details_labels" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Panel ID="Panel2" runat="server">
                    <asp:DropDownList ID="ddSubcategory" runat="server" CssClass="details_text">
                    </asp:DropDownList>
                </asp:Panel>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ddCategory" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:Label ID="lbSafetyStockLevel" runat="server" Text="Safety Stock Level: " CssClass="details_labels" />
        <asp:TextBox ID="txtSafetyStockLevel" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtSafetyStockLevel" CssClass="validator" Display="Dynamic"
            ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Podaj w formie liczby"
            ControlToValidate="txtSafetyStockLevel" CssClass="validator" Display="Dynamic"
            ValidationGroup="validatorsGroup" ValidationExpression="^[0-9]{0,5}$"></asp:RegularExpressionValidator>
        <asp:Label ID="lbReorderPoint" runat="server" Text="Reorder Point" CssClass="details_labels" />
        <asp:TextBox ID="txtReorderPoint" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtReorderPoint" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Podaj w formie liczby"
            ControlToValidate="txtReorderPoint" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"
            ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
        <asp:Label ID="lbStandardCost" runat="server" Text="Standard Cost: " CssClass="details_labels" />
        <asp:TextBox ID="txtStandardCost" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtStandardCost" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="Podaj w formie liczby"
            ControlToValidate="txtStandardCost" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"
            ValidationExpression="^[0-9]*[,]?[0-9]*?$"></asp:RegularExpressionValidator>
        <asp:Label ID="lbListPrice" runat="server" Text="List Price: " CssClass="details_labels" />
        <asp:TextBox ID="txtListPrice" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtListPrice" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="Podaj w formie liczby"
            ControlToValidate="txtListPrice" CssClass="validator" Display="Dynamic" ValidationGroup="validatorsGroup"
            ValidationExpression="^[0-9]*[,]?[0-9]*?$"></asp:RegularExpressionValidator>
        <asp:Label ID="lbDaysToManufacture" runat="server" Text="Days To Manufacture: " CssClass="details_labels" />
        <asp:TextBox ID="txtDaysToManufacture" runat="server" CssClass="details_text" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Pole nie może być puste"
            ControlToValidate="txtDaysToManufacture" CssClass="validator" Display="Dynamic"
            ValidationGroup="validatorsGroup"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ErrorMessage="Podaj w formie liczby"
            ControlToValidate="txtDaysToManufacture" CssClass="validator" Display="Dynamic"
            ValidationGroup="validatorsGroup" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
        <asp:Label ID="lbRowGUID" runat="server" Text="Row GUID:" CssClass="details_labels" />
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="txtRowGUID" runat="server" CssClass="details_text" Enabled="false"/>
                <asp:LinkButton ID="lnkGenerate" runat="server" Text="Generuj GUID" ClientIDMode="Static" onclick="lnkGenerate_Click" CssClass="link" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="lnkGenerate" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:Label ID="lbMakeFlag" runat="server" Text="Make Flag:" CssClass="details_labels" />
        <asp:CheckBox ID="chbMakeFlag" runat="server" CssClass="details_text" />
        <asp:Label ID="lbFinishedGoodsFlag" runat="server" Text="Finished Goods Flag:" CssClass="details_labels" />
        <asp:CheckBox ID="chbFinishedGoodsFlag" runat="server" CssClass="details_text" />
    </div>
    <div id="buttons">
        <asp:LinkButton ID="lnkAdd" runat="server" Text="Dodaj produkt" OnClick="lnkAdd_Click"
            CssClass="button" ValidationGroup="validatorsGroup" />
        <asp:LinkButton ID="lnkBack" runat="server" Text="Powrót do menu" PostBackUrl="~/index.aspx"
            CssClass="button" />
    </div>
</asp:Content>
